 <div id="content"> <!-- Content begins here -->
                
                <?php echo $this->element('admin/flash') ?>
                <div class="clear"></div>
                <h2>Comments</h2>
                
                <a class="btn" href="<?php echo $html->url(array('controller' => 'news', 'action' => 'comments')); ?>"><b>All comments(<?php echo $count_all; ?>)</b></a>
                
                <?php if($count_published) : ?>
                <a class="btn ml10" href="<?php echo $html->url(array('controller' => 'news', 'action' => 'comments','published')); ?>"><b>Published (<?php echo $count_published; ?>)</b></a>
                
                <?php endif; ?>
                
                <?php if($count_locked) : ?>
                <a class="btn ml10" href="<?php echo $html->url(array('controller' => 'news', 'action' => 'comments','locked')); ?>"><b>Pending (<?php echo $count_locked; ?>)</b></a>
                
                <?php endif; ?>
                
                <div class="clear"></div>
                
                
                <br /><br />
                
                
                <table cellspacing="0" cellpadding="0" border="0"><!-- Table -->
                    <thead>
                        <tr>
                            <th width="21%">Header</th>
                            <th width="10%">User</th>
                            <th width="5%">Date</th>
                            <th width="55%">Comment</th>
                            <th width="9%">Action</th>
                            
                        </tr>
                    </thead>
                
                    <tbody >
                        <?php
                        if($comments) :
                        foreach($comments as $key => $row) :
                        ?>
                        <tr <?php if($row['Comment']['status']!='published') echo 'class="unpublished"' ?>>
                            
                            <td>
                                
                                <?php echo $text->excerpt($row['News']['header'],'',20) ?>
                            </td>
                            
                            <td><?php echo $row['User']['name'] ?></td>
                            <td><?php echo $row['Comment']['created'] ?></td>
                            <td class="comment_body">
                                <div class="c_body">
                                    <?php echo nl2br($row['Comment']['body']); ?>
                                </div>
                                <div class="c_form hidden">
                                    <?php 
                                        echo $form->create('Comment',array('url'=>'/admin/news/edit_comment'));
                                        echo $form->input('id',array('value'=>$row['Comment']['id']));
                                        echo $form->input('body',array('value'=>$row['Comment']['body'],'label'=>false,'class'=>' bangla','style'=>'width:93%;'));
                                        echo '<input class="fl" name="data[Comment][status]" value="published" '.($row['Comment']['status']=='published'?'checked="checked"':'').' type="radio" /><label>Publish</label><br clear="all" />';
                                        echo '<input  class="fl" name="data[Comment][status]" value="locked" '.($row['Comment']['status']=='locked'?'checked="checked"':'').' type="radio" /><label>Unpublish</label>';
                                        echo '<span class="btn clear"><input type="submit" value="Update" /></span>';
                                        
                                        echo $form->end();
                                    ?>
                                    
                                </div>
                                
                            </td>
                            
                            <td>
                                
                                <a href="javascript:" title="Edit this comment" class="edit_comment"><?php echo $html->image('assets/action_add.png') ?></a>
                                
                                
                                <a onclick="return confirm('Are you sure, you want to delete this comment?');" title="delete this coment" href="<?php echo $html->url(array('controller' => 'news', 'action' => 'delete_comment', $row['Comment']['id'])); ?>"><?php echo $html->image('assets/action_delete.png') ?></a>
                                
                            </td>
                        </tr>
                        <?php endforeach;
                            else:
                        ?>
                        <tr>
                            
                            <td colspan="5">No comments avilable in range</td>
                            
                        </tr>
                        <?php endif ?>
                        
                        
                        
                    </tbody>
                </table> <!-- END Table -->
                
                
               

            
        </div> <!-- END Content -->
 
 
 
